/**
 * 
 */
package com.hson.demo.base.constant;

/**
 * 参数及常量定义
 * 
 * @author Hungel.zou
 * @time 2015年6月8日 下午8:17:14
 */
public class BaseConstants {
	// 验证码
	public static final String CAPTCHA = "CAPTCHA";
	public static final String VALID_CAPTCHA = "1";
	// 登录失效或者过期
	public static final String AUTHENTICATION_ERROR = "-99";
	//
	public static final String ERR_MSG = "errMsg";
	public static final String ERR_CODE = "errCode";
	public static final String EXCEPTION = "系统繁忙，请稍候再试";

	public static final String CODE = "ErrCode";
	public static final String DESC = "ErrDesc";
	public static final String RETURN = "returnObject";
	public static final String SUCCESS = "0";
	public static final String FAILURE = "-1";

	public static final int ENABLED = 0;
	public static final int UNENABLED = 1;
	public static final String ADMIN = "admin";

	/**
	 * 用户基本参数定义
	 * 
	 * @author Hungel.zou
	 * @time 2016年4月21日 下午9:32:28
	 */
	public static class User{
		//状态：0正常 1停用 9删除
		public static final int ENABLED = 0;
		public static final int UNENABLED = 1;
		public static final int DELETED = 9;
		
		//用户类型：0内部，1外部
		public static final int INNER = 0;
		public static final int OUTTER = 1;
		
		// 用户来源：0后台创建 1微信关注 2web申请 3app申请
		public static final int SOURCE_ADMIN_CREATE = 0;
		public static final int SOURCE_WECHAT_CREATE = 1;
		public static final int SOURCE_WEB_APPLICATION = 2;
		public static final int SOURCE_APP_APPLICATION = 3;
		
		// 是否管理员 0否 1是
		public static final int NOT_ADMIN = 0;
		public static final int IS_ADMIN = 1;
	}
	
	/**
	 * 登录key
	 * 
	 * @author Hungel.zou
	 * @time 2015年11月25日 下午9:38:57
	 */
	public static class LoginKey {
		public static final String USER = "user";
		public static final String USER_EXT = "userExt";

		public static final String AUTH = "auth";
		public static final String USER_LEVEL = "userLevel";
		public static final String IDENTITY = "identity";
	}

	public static final String YES = "Y";
	public static final String NO = "N";

	public static final String USER = "admin";
	public static final String AUTH_KEY = "auth_key";
	public static final String MENU = "menu";
	public static final String RETURN_URL = "returnUrl";

	public static final String AUTH_ID = "authenticationId";
	public static final String AUTH_NAME = "userId";
	public static final String AUTH_ERROR = "authenticationError";

	/**
	 * 会员之间的消息、留言
	 * 
	 * @author Hungel zou
	 * @time 2014年9月20日 下午2:48:50
	 */
	public static class UserMsg {
		/** 是否已读 0未读 1已读' */
		public static final int MSG_UNREAD = 0;
		public static final int MSG_READ = 1;

		/** 是否作者: 1是 0不是 */
		public static final int MSG_NOT_AUTHOR = 0;
		public static final int MSG_IS_AUTHOR = 1;

		/** 业务类型 0聊天，1留言 */
		public static final int MSG_BT_TALK = 0;
		public static final int MSG_BT_LEAVE = 1;
		public static final int MSG_BT_SYS = 2;

		/** 聊天还是留言 */
		public static final boolean IS_CHAT = true;
		public static final boolean IS_LEAVE = false;
	}

	public static class UserSessionKey {
		public static final String USERNAME = "user_name";
		public static final String KEEP_TIME = "last_keep_session_time";
		public static final String AUTH_KEY = "auth_key";
	}

	/**
	 * 可登录系统角色
	 * 
	 * @author Hungel.zou
	 * @time 2015年6月21日 下午8:50:45
	 */
	public static class Role {
		/** 系统角色 */
		public static final int IS_SYSTEM = 0;
		/** 业务角色 */
		public static final int IS_BUSINESS = 1;

		/** 角色失效 */
		public static final int IS_INVALID = 0;
		/** 角色生效 */
		public static final int IS_VALIDATE = 1;
	}

	/**
	 * 登录设备端
	 * 
	 * @author Hungel zou
	 * @time 2014年11月6日 下午4:38:58
	 */
	public static class LoginDevices {
		public static final String WEB = "web";
		public static final String APP = "app";
	}

	public static class MobileVersion {
		public static final String ANDRIOD = "android";
		public static final String IOS = "ios";
	}

	/**
	 * 登录用户操作日志
	 * 
	 * @author Hungel.zou
	 * @time 2015年7月6日 下午1:51:46
	 */
	public static class UserOperation {
		// 操作方式：1新增 2修改(更新) 3删除 4查询 5审核
		public static final int NEW_ADD = 1;
		public static final int MODIFICATION = 2;
		public static final int DELETE = 3;
		public static final int QUERY = 4;
		public static final int AUDIT = 5;

		// 登录、退出
		public static final int APP_LOGIN = 20;
		public static final int APP_LOGOUT = 21;

		public static final int OPEATION_LOGIN = 22;
		public static final int OPEATION_LOGOUT = 23;

		public static final int ADMIN_LOGIN = 24;
		public static final int ADMIN_LOGOUT = 25;
	}

	/**
	 * 权限常量
	 * 
	 * @author Hungel.zou
	 * @time 2015年7月13日 下午6:03:35
	 */
	public static class Privileges {

		/** 权限使用目标：web端 */
		public static final int TARGET_WEB = 1;
		/** 权限使用目标：app端 */
		public static final int TARGET_APP = 2;

		/** 权限类型:菜单 */
		public static final int PRIV_MENU = 1;
		/** 权限类型:权限 */
		public static final int PRIV_PRIVILEGE = 2;

		/** 菜单/权限是否显示 0不显示 */
		public static final int SHOW_NO = 0;
		/** 菜单/权限是否显示 1显示 */
		public static final int SHOW_YES = 1;

		/** 是否可授权 0不可以 */
		public static final int AUTHORIZATION_NO = 0;
		/** 是否可授权 1可以 */
		public static final int AUTHORIZATION_YES = 1;
	}

	/**
	 * 权限系统对象
	 * 
	 * @author Hungel.zou
	 * @time 2015年7月18日 上午9:44:03
	 */
	public static class Applications {
		// 是否开放管理 0否 1是
		public static final int MANAGER_DENY = 0;
		public static final int MANAGER_OPEN = 1;
		// 是否生效 0不生效 1生效
		public static final int IS_INVALID = 0;
		public static final int IS_VALIDATE = 1;
	}

}
